package com.oocl.customer.servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oocl.customersystem.pojo.Order;
import com.oocl.customersystem.util.RequestUtil;

/**
 * Servlet implementation class RemoveAllOrders
 */
public class RemoveAllOrders extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.getSession().setAttribute("cart", null);
		List<Order> list =new  ArrayList<Order>();
		String json = RequestUtil.wrapToJson(list);
		response.setContentType("application/json;charset=utf-8");
		response.getWriter().write(json);
		
	}

}
